<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>


<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>测试</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="robots" content="all,follow">
    <!-- Bootstrap CSS-->
    <link href="/common/Bootstrap-Wizard/example/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <!-- theme stylesheet-->
    <link rel="stylesheet" href="/common/JxcpcsPage/css/style.default.css" id="theme-stylesheet">
    <link rel="stylesheet" href="/common/JxcpcsPage/jquery-labelauty.css">
    <link href="/common/Bootstrap-Wizard/example/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" />
    <link href="/common/Bootstrap-Wizard/css/bwizard.min.css" rel="stylesheet" />
    <style>
        input {
            font: 12px "Microsoft Yahei";
        }
    </style>

</head>
<body>
<div class="page">
    <div class="container-fluid">
        <div id="wizard">
            <ol style="position:fixed;border:1px solid #3c763d;border-radius:5px;">
            <c:forEach var="item" items="${jxcpymrzList}">
                <li>${item.sname}</li>
            </c:forEach>
            </ol>
            <p style="height: 30px;"></p>
            <c:forEach var="item" items="${jxcpymrzList}" varStatus="index">
                <div class="card">
                    <div class="card-header d-flex align-items-center">
                        <h3 class="h4" style="color: #0000ff;">${item.bz}</h3>
                    </div>
                    <div class="card-body">
                        <div class="row" style="padding-left: 30px;">
                            <c:forEach var="cs_item" items="${item.cs}">
                                <div style="width: 24%;float: left;margin-left: 3px;">
                                    <input style="vertical-align:middle;color:#000000;" value="${cs_item.id}" type="checkbox" name="checkbox" data-labelauty="${cs_item.sname}" />
                                </div>
                            </c:forEach>
                        </div>
                        <c:if test="${index.index==jxcpymrzList.size()-1}">
                            <div class="row" style="text-align:center">
                                <div class="col-lg-12">
                                    <button id="btlogin" type="button" data-toggle="modal" data-target="#myModal" class="btn btn-primary">提 交</button>
                                </div>
                            </div>
                        </c:if>
                    </div>
                </div>
            </c:forEach>
        </div>
    </div>

</div>

<form id="f2" action="/com/imelite/qyh/EliteView_YyxxAction/yyxxByTelPage.do" method="post">
    <input id="iddep" type="hidden" name="iddep" value="${iddep}">
</form>
<!-- JavaScript files-->
<script src="/common/Bootstrap-Wizard/example/js/jquery.min.js"></script>
<script src="/common/JxcpcsPage/vendor/popper.js/umd/popper.min.js"> </script>
<script src="/common/Bootstrap-Wizard/example/bootstrap/js/bootstrap.min.js"></script>
<!-- Main File-->
<script src="/common/JxcpcsPage/jquery-labelauty.js"></script>
<script src="/common/Bootstrap-Wizard/js/bwizard.min.js" type="text/javascript"></script>
    <script>
        $("#wizard").bwizard();
    $(function(){

        $(':input').labelauty();
    });

    $('#btlogin').click(function(){
        var checkID = [];//定义一个空数组
        $("input[name='checkbox']:checked").each(function(i){//把所有被选中的复选框的值存入数组
            checkID[i] =$(this).val();
        });

        if(checkID.length>0){
            $.ajax({
                type: "POST",
                data:{
                    yyxxid:'${yyxxid}',
                    idlist:checkID.join(',')
                },
                url: "/com/imelite/qyh/YycpbgAction/insert.do",
                success: function(result) {
                    if ( result.code == 200 ) {
                        window.location.href="/com/imelite/qyh/JxcpcsAction/getSubmitAccessPage.do?yyxxid=${yyxxid}&iddep=${iddep}";
                        //$('#f2').submit();
                    } else {
                        alert(result.msg);
                    }
                },
                error:function(data){
                    alert("系统异常！");
                }
            });

        }else{
            alert("您还未进行选择");
        }

    });
</script>
</body>
</html>
